package com.wantup.service.proxy;

import com.wantup.service.OrderService;

/**
 * 采用静态代理的方式
 * 静态代理也要实现公共接口
 */
public class OrderServiceProxy implements OrderService {

    /**
     * 被代理对象
     */
    private OrderService orderService;

    public OrderServiceProxy(OrderService orderService) {
        this.orderService = orderService;
    }

    @Override
    public void order() throws Throwable {
        System.out.println("我是静态代理类...");
        System.out.println(">>>打印订单日志开始。。。");
        orderService.order();
        System.out.println(">>>打印订单日志结束。。。");
    }




}
